{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-02-01T10:05:37.667535Z",
     "start_time": "2021-02-01T10:05:37.661551Z"
    }
   },
   "outputs": [],
   "source": [
    "import warnings\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Deep_Forest"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## API接口"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "deepforest.CascadeForestClassifier："
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 参数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "|Parameters|范围|含义|\n",
    "|-|-|-|\n",
    "|n_bins|int, default=255,$\\in[2,255]$|非missing取值的分区数|\n",
    "|bin_subsample|||\n",
    "|max_layers|int,default = 20|构建的Cascade Layer的最深层数|\n",
    "|n_estimators|int,default = 2|Cascade Layer中每层的基评估器数目|\n",
    "|n_trees|int,default = 100|每个评估器中树的数目|\n",
    "|max_depth|int, default= None|构建的树的最大深度|\n",
    "|min_samples_leaf|int, default=1|构成叶节点所需的最小样本数|\n",
    "|use_predictor|bool, default=False|是否使用predictor来协助提高预测性能|\n",
    "|predictor|{\"forest\",\"xgboost\",\"lightbgm\"},default=\"forest\"||\n",
    "|n_tolerant_rounds|int,default=2|early stoping的tolerant的轮次|\n",
    "|delta|float,default=1e-5|early stopping的阈值|\n",
    "|partial_mode|bool,default=False|大数据量时，推荐使用|\n",
    "|n_jobs|int or None, default = None||\n",
    "|random_state|int or None, default = None||\n",
    "|verbose|int,default=1|<=0,silent mode；1 display logging information on the cascade layer；>1, display full logging information|"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 函数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- predict_proba(x)\n",
    "- predict(x)\n",
    "- fit(X,y)\n",
    "- load(dirname)\n",
    "- save(dirname = 'model')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Load Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2021-02-01T10:05:52.499577Z",
     "start_time": "2021-02-01T10:05:51.817445Z"
    }
   },
   "outputs": [],
   "source": [
    "from sklearn.datasets import load_digits\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X, y = load_digits(return_X_y=True)\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Define the Model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from deepforest import CascadeForestClassifier\n",
    "\n",
    "model = CascadeForestClassifier()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
